/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.util;

import cn.hutool.core.convert.Converter;
import cn.hutool.core.convert.ConverterRegistry;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;

/**
 * @className MongoPlusConverter
 * @description _id类型转换
 * @author THINK
 * @date 2024/6/12 11:26
 * @version v1.0
**/
@NoArgsConstructor
public class MongoPlusConverter implements Converter<ObjectId>{

    @Override
    public ObjectId convert(Object value, ObjectId defaultValue) throws IllegalArgumentException {
        System.err.println("-----------------MongoPlusConverter--------------------");
        System.err.println(value);
        System.err.println(defaultValue);
        return null;
    }

    static {
        ConverterRegistry registry = ConverterRegistry.getInstance();
        registry.putCustom(ObjectId.class, MongoPlusConverter.class);
    }
}
